<template>
  <div>
    <article>
      <ul class="news-wrap">
        <li
          class="new-list"
          v-for="item in list"
          :key="item.title"
          @click="goDetail(item.docid)"
        >
          <div class="news-info">
            <h3 v-html="item.title"></h3>
            <div class="news-title">
              <span class="news-source">{{ item.source }}</span>
              <span class="pun-time">{{ item.ptime }}</span>
              <span class="reply">{{ item.tcount }}跟帖</span>
            </div>
          </div>
          <div class="news-pic" v-for="k in item.picInfo" :key="k.ref">
            <van-image width="100" height="100" :src="k.url" :v-lazy="k.url" />
          </div>
        </li>
      </ul>
    </article>
  </div>
</template>
<script>
export default {
  props:{
    list:Array
  },
  methods:{
    goDetail(id){
      this.$router.push({
        path:'/news-detail',
        query:{
          id
        }
      })
    }
  }
}
</script>
<style lang="less" scoped>
.news-wrap {
  background: #fff;
  padding: 0 20px 20px;
  .new-list {
    margin-bottom: 20px;
    position: relative;
    display: flex;
    justify-content: space-between;
    .news-info {
      .open-app {
        width: 90px;
        height: 20px;
        line-height: 20px;
        border: 1px solid #ee1a1a;
        color: #ee1a1a;
        font-size: 13px;
        text-align: center;
        border-radius: 10px;
        position: absolute;
        right: 112px;
        bottom: 0;
      }
      h3 {
        -webkit-line-clamp: 3;
        max-height: 40px;
        padding-right: 10px;
        -webkit-box-orient: vertical;
        font-size: 16px;
        font-weight: 400;
        line-height: 22px;
        overflow: hidden;
        text-overflow: ellipsis;
        word-break: break-word;
      }
      .news-title {
        color: #b4b4b4;
        font-size: 0;
        height: 25px;
        letter-spacing: 0;
        line-height: 20px;
        margin-top: 12px;
        overflow: hidden;
        span {
          display: inline-block;
          // font-size: 0.24rem;
          margin-right: 5px;
          font-size: 12px;
          overflow: hidden;
          white-space: nowrap;
        }
      }
    }
  }
}

.line {
  width: 100%;
  height: 10px;
  background: red;
}
</style>
